﻿using CuaHangLego.DataAccess;
using CuaHangLego.Model;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CuaHangLego.Bussiness.Parser
{
    public class NhatKySanPhamParser
    {
        public static NhatKySanPham Parse(SqlDataReader sdata)
        {
            NhatKySanPham nk = new NhatKySanPham();
            nk.ThoiGian = DateTime.Parse(sdata["ThoiGian"].ToString());
            nk.SoLuong = int.Parse(sdata["SoLuong"].ToString());
            nk.SanPham = SanPhamDA.Instance.GetByID(int.Parse(sdata["SanPhamID"].ToString()));
            return nk;
        }
    }
}
